/*
 * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: CC0-1.0
 */

#include <stdio.h>
#include <inttypes.h>
#include "wifi_sta_driver.h"
#include "nvs_flash.h"

char ssid[]="dev";
char passwd[]="cdec1234";



void app_main(void)
{
    esp_err_t ret;
    ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
        ESP_ERROR_CHECK(nvs_flash_erase());
        ret = nvs_flash_init();
    }
    ESP_ERROR_CHECK(ret);
    ret = wifi_sta_enable();
    ESP_ERROR_CHECK(ret);
    wifi_sta_set_cfg(ssid,passwd);
    wifi_sta_connection();
    while (1)
    {
        vTaskDelay(pdMS_TO_TICKS(10)); //延时10ms
    }
    
}
